package info.techgeek.labs.rmi;

import java.awt.Cursor;
import java.awt.Robot;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.InputEvent;

import javax.swing.JFrame;

/*public class MyRobot extends JFrame implements ActionListener  {

	public static void main(String[] args) {
		
		Robot robot = new Robot();
		int xStart = 100;
		int yStart = 200;
		robot.mouseMove(xStart, yStart);

		// Change the cursor to a hand and delay
		setCursor(new Cursor(Cursor.HAND_CURSOR));
		robot.delay(1000);

		// Use double precision to avoid cumulative
		// arithmetic errors. Calculate the
		// incremental distance for animated mouse
		// pointer movement. Make animation speed
		// appropriate for distance to be traveled.
		double div;
		if ((xLoc - xStart) < 50.0)
			div = 15;
		else if ((xLoc - xStart) < 100.0)
			div = 30;
		else
			div = 60;

		double xInc = (xLoc - xStart) / div;
		double yInc = (yLoc - yStart) / div;

		// Initialize, and then execute a loop to move
		// the mouse pointer from the starting
		// position to the center of the button.
		// Sleep for 60 msec between each movement.
		double x = xStart;
		double y = yStart;
		while (((int) x < xLoc) || ((int) y < yLoc)) {
			x += xInc;
			y += yInc;
			robot.mouseMove((int) x, (int) y);
			robot.delay(60);
		}// end while loop

		// Press and then release the left mouse
		// button when the mouse pointer is resting
		// in the location of the JToggleButton.
		robot.mousePress(InputEvent.BUTTON1_MASK);
		robot.mouseRelease(InputEvent.BUTTON1_MASK);

		// Return the cursor to the starting position
		// and restore it to a default pointer.
		robot.delay(1000);
		robot.mouseMove(xStart, yStart);
		
	}

	public void actionPerformed(ActionEvent e) {
		// TODO Auto-generated method stub
		
	}
	
}*/
